package a_o2odata_deal.utils.zhibo_qy

import a_aa_amainpackage.a_o2odata_deal.config.config.{months, years}
import org.apache.spark.sql.SQLContext

/**
  * @ Auther: o2o-rd-0008
  * @ Date:   2020/2/11 16:02
  * @ Param:  ${PARAM}
  * @ Description: 
  */
object update_tmall_taobao_alluserid {
  def update_tmall_taobao_alluserid(sqlContext:SQLContext):Unit={
    val tm_data = sqlContext.read.orc(s"s3a://o2o-dataproces-group/panzonghao/tmall/${years}/${months}/zhibo_finally")
      .selectExpr("userId").dropDuplicates()
    val tb_data = sqlContext.read.orc(s"s3a://o2o-dataproces-group/panzonghao/taobao/${years}/${months}/zhibo_finally")
      .selectExpr("userId").dropDuplicates()

    tm_data.repartition(4).write.json(s"s3a://o2o-dataproces-group/panzonghao/tmall/all_userid/${years}/${months}")
    tb_data.repartition(4).write.json(s"s3a://o2o-dataproces-group/panzonghao/taobao/all_userid/${years}/${months}")

  }

}
